#import "Three20/TTURLMap.h"
#import "Three20/TTModel.h"

///////////////////////////////////////////////////////////////////////////////////////////////////

#define TT_NULL_Need_INDEX NSIntegerMax

@protocol TTNeed;
@class TTURLRequest;

typedef enum {
	TTNeedVersionNone,
	TTNeedVersionLarge,
	TTNeedVersionMedium,
	TTNeedVersionSmall,
	TTNeedVersionThumbnail
} TTNeedVersion;

///////////////////////////////////////////////////////////////////////////////////////////////////

@protocol TTNeedSource <TTModel, TTURLObject>

/**
 * The title of this collection of Needs.
 */
@property(nonatomic,copy) NSString* title;

/**
 * The total number of Needs in the source, independent of the number that have been loaded.
 */
@property(nonatomic,readonly) NSInteger numberOfNeeds;

/**
 * The maximum index of Needs that have already been loaded.
 */
@property(nonatomic,readonly) NSInteger maxNeedIndex;

/**
 *
 */
- (id<TTNeed>)NeedAtIndex:(NSInteger)index;

@end

///////////////////////////////////////////////////////////////////////////////////////////////////

@protocol TTNeed <NSObject, TTURLObject>

/**
 * The Need source that the Need belongs to.
 */
@property(nonatomic,assign) id<TTNeedSource> NeedSource;

/**
 * The index of the Need within its Need source.
 */
@property(nonatomic) CGSize size;

/**
 * The index of the Need within its Need source.
 */
@property(nonatomic) NSInteger index;

/**
 * The caption of the Need.
 */
@property(nonatomic,copy) NSString* caption;

/**
 * Gets the URL of one of the differently sized versions of the Need.
 */
- (NSString*)URLForVersion:(TTNeedVersion)version;

@end
